package avicit.bdp.dms.dss.enums;

import avicit.bdp.core.enums.BaseEnum;

/**
 * @author ma
 * api接口调用状态码
 */
public enum ApiCallStatus implements BaseEnum {

    SUCCESS(200, "成功"),
    SYSTEM_ERROR(500, "系统异常"),
    TOKEN_INVALID(250, "token校验失败"),
    CALL_DAY_MAX_LIMIT(251, "日调用次数超过最大限制"),
    CALLING_INTERFACE_NOT_FOUND(252, "调用接口不存在"),
    CALL_ERROR(253, "接口调用错误"),
    CALLING_INTERFACE_OFFLINE(254, "调用接口已下线"),
    NO_PERMISSION_CALL_INTERFACE(255, "您没有调用该接口的权限"),
    INVALID_PARAM(256, "请求参数错误"),
    USER_UNSUBSCRIBE(257, "用户未订阅该服务或服务审核未通过"),
    DATE_EXPIRED(258, "服务有效日期已经过期"),
    IP_BLACK_LIST(259, "您的IP被设置成黑名单，请联系系统管理员"),
    VISIT_LIMIT(260, "您在单位时间内已达到访问上限，请稍后再访问"),
    REQUEST_TIME_OUT(261, "请求接口超时"),
    CALLING_INTERFACE_METHOD_ERROR(262, "接口请求类型错误");

    private final int code;
    private final String description;

    ApiCallStatus(int code, String description){
        this.code = code;
        this.description = description;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

}
